<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Site extends CI_Controller {

	 public function index()
	 {
		$this->load->view('index');
	 }
	
	 public function welcome()
	 {
	 	$this->load->view('welcome');
	 }
		
	 public function pengumuman()
	 {
	 	$this->load->view('pengumuman');
	 }
	 
	 public function daftar() 
	 {
		$this->load->model('siteModel');
		$data['agama'] 		= $this->siteModel->getReffAgama();
		$data['propinsi']	= $this->siteModel->getReffPropinsi();
		$data['jenisSmta']	= $this->siteModel->getReffJenisSmta();
		$data['jurusanSmta']= $this->siteModel->getReffJurusanSmta();
		$data['jurusan']	= $this->siteModel->getReffJurusan();
		$data['lokasi']		= $this->siteModel->getReffLokasi();
		$data['lokasiTKD']	= $this->siteModel->getReffLokasiTKD();
		$data['lokasiTKA']	= $this->siteModel->getReffLokasiTKA();
		$data['data'] 		= $this->siteModel->setEmptyData();
		$data['is_validate'] = false;
		$data['is_success']  = false;
		$data['msg']		 = "";
		$data['img_1']		 = "";
		/*$data['pin'] 		 = $id;
		//$data = array('id' => $data1); */

		$this->load->view('form_pendaftaran', $data);
	 }
	 
	 public function validate(){
		// this all coming from form
		$nama					= $this->input->post('nama');
		$tempat_lahir			= $this->input->post('tempat_lahir');
		$tgl_lahir_dd			= $this->input->post('tgl_lahir_dd');
		$tgl_lahir_mm			= $this->input->post('tgl_lahir_mm');
		$tgl_lahir_yy			= $this->input->post('tgl_lahir_yy');		
		$jenis_kelamin 			= (strlen($this->input->post('jenis_kelamin')) > 0) ? $this->input->post('jenis_kelamin') : "NULL";
		$tinggi_badan			= $this->input->post('tinggi_badan');
		$agama					= $this->input->post('agama');
		$propinsiID				= $this->input->post('propinsiID');
		$tahun_lulus			= $this->input->post('tahun_lulus');
		$jenis_smtaID			= $this->input->post('jenis_smtaID');
		$jurusan_smtaID			= $this->input->post('jurusan_smtaID');
		$jurusanID				= $this->input->post('jurusanID');
		$lokasiID				= $this->input->post('lokasiID');
		$lokasiTKD				= $this->input->post('lokasiTKD');
		$lokasiTKA				= $this->input->post('lokasiTKA');
		$no_tkd					= $this->input->post('no_tkd');
		$mat_4					= $this->input->post('mat_4');
		$fisika_4				= $this->input->post('fisika_4');
		$inggris_4				= $this->input->post('inggris_4');
		$mat_5					= $this->input->post('mat_5');
		$fisika_5				= $this->input->post('fisika_5');
		$inggris_5				= $this->input->post('inggris_5');
		$mat_6					= $this->input->post('mat_6');
		$fisika_6				= $this->input->post('fisika_6');
		$inggris_6				= $this->input->post('inggris_6');
		$ayah					= $this->input->post('ayah');
		$ibu					= $this->input->post('ibu');
		$alamat					= $this->input->post('alamat');
		$kodepos				= $this->input->post('kodepos');
		$telepon				= $this->input->post('telepon');
		$email					= $this->input->post('email');
		
		$kota					= $this->input->post('kota');
		$image_1				= $_FILES['foto'];
		$agree					= (strlen($this->input->post('agree')) > 0) ? $this->input->post('agree') : "NULL";
		// end here
		
		$image_path 			= "./assets/images/foto_calon_taruna/";
		$image_Fotopath 		= "./assets/images/foto_calon_taruna/";
		$insert_image_1 		= "";
		$register_date			= $this->input->post('register_date');
		$emailNardi    			= "sipencatar2014@gmail.com"; //"ilham.biz@gmail.com"; //"saipul@thera.co.id"; //"sipencatar2014@gmail.com"; //"nardiamg@gmail.com";
		$date					= $tgl_lahir_dd."-".$tgl_lahir_mm."-".$tgl_lahir_yy;
		
		$this->load->model('siteModel');
		$lastID				= $this->siteModel->getLastID();
		$data['agama'] 		= $this->siteModel->getReffAgama();
		$data['propinsi']	= $this->siteModel->getReffPropinsi();
		$data['jenisSmta']	= $this->siteModel->getReffJenisSmta();
		$data['jurusanSmta']= $this->siteModel->getReffJurusanSmta();
		$data['jurusan']	= $this->siteModel->getReffJurusan();
		$data['lokasi']		= $this->siteModel->getReffLokasi();
		$data['lokasiTKD']	= $this->siteModel->getReffLokasiTKD();
		$data['lokasiTKA']	= $this->siteModel->getReffLokasiTKA();

		$codeJur = "";
		switch ($jurusanID) {
			case 1:
				$codeJur = "10";
				break;
			case 2:
				$codeJur = "30";
				break;
			case 3:
				$codeJur = "20";
				break;
			case 4:
				$codeJur = "40";
				break;
		}		
		
		//$no_pendaftaran		= $lokasiID. ($lastID['ID'] + 1);
		$no_pendaftaran		= $codeJur.
			str_pad($lokasiTKA, 2,"0",STR_PAD_LEFT).
			str_pad($lastID['ID'] + 1, 5,"0",STR_PAD_LEFT);
		
		$update 			= "";
		$sql 				= "";
		$img_1				= "";

		
		$this->load->helper(array('form', 'url'));
		$this->load->library('Form_validation');

		//$this->form_validation->set_rules('pin', 'pin', 'trim|required');
	    $this->form_validation->set_rules('nama', 'nama', 'trim|required');
	 	$this->form_validation->set_rules('tempat_lahir', 'tempat_lahir', 'trim|required');
	 	$this->form_validation->set_rules('tgl_lahir_dd', 'tgl_lahir_dd', 'trim|required');
		$this->form_validation->set_rules('tgl_lahir_mm', 'tgl_lahir_mm', 'trim|required');
		$this->form_validation->set_rules('tgl_lahir_yy', 'tgl_lahir_yy', 'trim|required');
		$this->form_validation->set_rules('jenis_kelamin', 'jenis_kelamin', 'trim|required');		
		$this->form_validation->set_rules('tinggi_badan', 'tinggi_badan', 'trim|required');				
		$this->form_validation->set_rules('agama', 'agama', 'trim|required');		
		$this->form_validation->set_rules('propinsiID', 'propinsiID', 'trim|required');		
		$this->form_validation->set_rules('tahun_lulus', 'tahun_lulus', 'trim|required');		
		$this->form_validation->set_rules('jenis_smtaID', 'jenis_smtaID', 'trim|required');		
		$this->form_validation->set_rules('jurusan_smtaID', 'jurusan_smtaID', 'trim|required');		
		$this->form_validation->set_rules('jurusanID', 'jurusanID', 'trim|required');		
		//$this->form_validation->set_rules('lokasiID', 'lokasiID', 'trim|required');		
		$this->form_validation->set_rules('lokasiTKD', 'lokasiTKD', 'trim|required');		
		$this->form_validation->set_rules('lokasiTKA', 'lokasiTKA', 'trim|required');		
		//$this->form_validation->set_rules('no_tkd', 'no_tkd', 'trim|required');		
		$this->form_validation->set_rules('mat_4', 'mat_4', 'trim|required');				
		$this->form_validation->set_rules('fisika_4', 'fisika_4', 'trim|required');				
		$this->form_validation->set_rules('inggris_4', 'inggris_4', 'trim|required');				
		$this->form_validation->set_rules('mat_5', 'mat_5', 'trim|required');				
		$this->form_validation->set_rules('fisika_5', 'fisika_5', 'trim|required');				
		$this->form_validation->set_rules('inggris_5', 'inggris_5', 'trim|required');				
		$this->form_validation->set_rules('mat_6', 'mat_6', 'trim|required');				
		$this->form_validation->set_rules('fisika_6', 'fisika_6', 'trim|required');				
		$this->form_validation->set_rules('inggris_6', 'inggris_6', 'trim|required');				
		$this->form_validation->set_rules('email', 'email', 'trim|required');
		$this->form_validation->set_rules('ayah', 'ayah', 'trim|required');
		$this->form_validation->set_rules('ibu', 'ibu', 'trim|required');
		$this->form_validation->set_rules('alamat', 'alamat', 'trim|required');
		$this->form_validation->set_rules('kodepos', 'kodepos', 'trim|required');
		$this->form_validation->set_rules('telepon', 'telepon', 'trim|required');
		$this->form_validation->set_rules('agree', 'agree', 'trim|required');
				
		if($image_1!=null){
			move_uploaded_file($image_1["tmp_name"], $image_path.$no_pendaftaran."_".$image_1["name"]);
			
			if ( $image_1["name"] != null )
				$this->createFotoCalonTaruna( $no_pendaftaran."_".$image_1["name"] );
				
			if (strlen( $image_1["name"]) > 0 ) {
				$img_1 	= "assets/images/foto_calon_taruna/".$no_pendaftaran."_". $image_1["name"];
			}
		}
		
		/*
		$data['pin'] = $pin;
		$data['is_valid'] = true;
		//$data['row'] =  $this->siteModel->getTarunaStatus($pin);
		$data['row'] = $this->siteModel->pinValidation($pin);
		if($data['row']) {
			if($data['row']['state']!=0) {
				$data['is_valid'] = false;
				$data['is_validate'] = true;
				$this->load->view('form_pendaftaran', $data);
			}
		}
		**/
		
		$data['data']['no_pendaftaran'] = $no_pendaftaran;
		$data['data']['nama'] 			= $nama;
		$data['data']['tempat_lahir']	= $tempat_lahir;
		$data['data']['tgl_lahir_dd']	= $tgl_lahir_dd;
		$data['data']['tgl_lahir_mm']	= $tgl_lahir_mm;
		$data['data']['tgl_lahir_yy']	= $tgl_lahir_yy;	
		$data['data']['jenis_kelamin'] 	= $jenis_kelamin;
		$data['data']['tinggi_badan'] 	= $tinggi_badan;
		$data['data']['agama'] 			= $agama;
		$data['data']['propinsiID'] 	= $propinsiID;
		$data['data']['tahun_lulus'] 	= $tahun_lulus;
		$data['data']['jenis_smtaID'] 	= $jenis_smtaID;
		$data['data']['jurusan_smtaID'] = $jurusan_smtaID;
		$data['data']['jurusanID'] 		= $jurusanID;
		$data['data']['lokasiID'] 		= $lokasiID;
		$data['data']['lokasiTKD'] 		= $lokasiTKD;
		$data['data']['lokasiTKA'] 		= $lokasiTKA;
		$data['data']['no_tkd']			= $no_tkd;
		$data['data']['mat_4'] 			= $mat_4;
		$data['data']['fisika_4'] 		= $fisika_4;
		$data['data']['inggris_4'] 		= $inggris_4;
		$data['data']['mat_5'] 			= $mat_5;
		$data['data']['fisika_5'] 		= $fisika_5;
		$data['data']['inggris_5'] 		= $inggris_5;
		$data['data']['mat_6'] 			= $mat_6;
		$data['data']['fisika_6'] 		= $fisika_6;
		$data['data']['inggris_6'] 		= $inggris_6;
		$data['data']['ayah'] 			= $ayah;
		$data['data']['ibu'] 			= $ibu;
		$data['data']['alamat'] 		= $alamat;
		$data['data']['kodepos'] 		= $kodepos;
		$data['data']['telepon'] 		= $telepon;
		$data['data']['email'] 			= $email;
		
		$data['img_1']					= $img_1;
		
		/*
		$image_1 			= $_FILES['foto'];
		$image_path 		= "./assets/images/foto_calon_taruna/";
		$image_Fotopath = "./assets/images/foto_calon_taruna/";
		$insert_image_1 	= "";
		$register_date		= $this->input->post('register_date');
		$emailNardi    		= "nardiamg@gmail.com";
		$agree				= (strlen($this->input->post('agree')) > 0) ? $this->input->post('agree') : "NULL";
		$date				= $tgl_lahir_dd."-".$tgl_lahir_mm."-".$tgl_lahir_yy;
		*/

		if ($this->form_validation->run() == FALSE){
			//redirect("site/form_required/field_required/".$pin);
			$data['is_validate'] 	= true;
			$data['is_success'] 	= false;
			$data['msg'] 			= "Error: Isi semua field bertanda (*).";
			
			
			$this->load->view('form_pendaftaran', $data);
		} else {
			$url_detail = base_url()."site/pendaftaranDetail/".$no_pendaftaran;
			
			if($email != null){
				$row = $this->siteModel->getSameEmail($email);
				
				if($row == NULL ) {
					// find nomor tagihan
					$bill = $this->siteModel->getValidBillingNo();
					
					$data['from']		=	'registrasi@amg.ac.id - Panitia Seleksi Penerimaan Calon Taruna Baru';
					$data['to']			=	$email.', '. $emailNardi;
					$data['subject']	=	'Akademi Meteorologi dan Geofisika - Konfirmasi Pendaftaran Calon Taruna Baru';
					$data['message']	=	'Kepada, '.$nama.
											'<br /><br />
											Silahkan melanjutkan proses pendaftaran anda sebagai Calon Taruna Baru - Akademi Meteorologi dan Geofisika Tahun 2014/2015 dengan melakukan pembayaran uang pendaftaran sebesar Rp. 75.000,00 melalui bank BNI cab. Mayestik dengan menyertakan No. Tagihan Anda : '.$bill['BILLING_NO'].
											'<br /><br />Klik Link di bawah ini untuk melihat detail pendaftaran :<br /><br />'.
											'<a href="'.$url_detail.'">'.$url_detail.'</a><br />
											<br />Terima Kasih<br />
											<br />Panitia PTB STMKG 2014/2015<br />';
					
					$data['kota']		= $kota;
					
					// for development
					$data['bcc']		= 'ilham.biz@gmail.com, saipul@thera.co.id';
					$response = $this->sentEmail($data);
					
					// disable PPIN 
					//$sql = "UPDATE pin set state = 1
						//	WHERE pin = $pin";

					//$this->db->query($sql);
					//----
				
					// insert record			
					$t_billing_id = $bill['T_BILLING_ID'];
					$sql = "INSERT INTO student_register(
								no_pendaftaran, nama, tempat_lahir, tgl_lahir, jenis_kelamin, tinggi_badan, agama,
								propinsiID, tahun_lulus, jenis_smtaID, jurusan_smtaID, jurusanID, lokasiID, lokasiTKD, lokasiTKA, t_billing_id, 
								mat_4, fisika_4, inggris_4, mat_5, fisika_5, inggris_5, mat_6, fisika_6, inggris_6, register_date, 
								email, ayah, ibu, alamat, kodepos, telepon, foto,
								valid_to)
							
							VALUES (
								'$no_pendaftaran', '$nama', '$tempat_lahir', '$date', '$jenis_kelamin', '$tinggi_badan', '$agama',
								'$propinsiID', '$tahun_lulus', '$jenis_smtaID', '$jurusan_smtaID', '$jurusanID', '$lokasiID', $lokasiTKD, $lokasiTKA, '$t_billing_id',
								'$mat_4', '$fisika_4', '$inggris_4', '$mat_5', '$fisika_5', '$inggris_5', '$mat_6', '$fisika_6', '$inggris_6', now(), 
								'$email', '$ayah', '$ibu', '$alamat', '$kodepos', '$telepon', '$img_1', ADDDATE(NOW(), INTERVAL 4 DAY) )";
					//-----
						
					$data['messagePopup']	=	'Kepada, '.$nama.
							'<br /><br />
							Silahkan melanjutkan proses pendaftaran anda sebagai Calon Taruna Baru - Akademi Meteorologi dan Geofisika Tahun 2014/2015 dengan melakukan pembayaran uang pendaftaran sebesar Rp. 75.000,00 melalui bank BNI cab. Mayestik dengan menyertakan No. Tagihan Anda : '.$bill['BILLING_NO'].
							'<br />
							<br />Terima Kasih<br />
							<br />Panitia PTB STMKG 2014/2015<br />';

					if (strlen($sql)> 0 ) {
						$this->db->query($sql);

						// disable PIN 
						$sql = "UPDATE T_BILLING set state = 1, UPDATE_DATE = now()
								WHERE T_BILLING_ID = '$t_billing_id'";

						$this->db->query($sql);
						//----
						
						//$data['pin'] = $pin;
						$data['is_valid'] = true;
						//$data['row'] =  $this->siteModel->getTarunaStatus($no_tkd);
						//$data['row'] = $this->siteModel->pinValidation($pin);
						$data['is_success'] 	= true;
						$data['is_validate'] 	= false;
						
						$this->load->view('form_pendaftaran', $data);
					}
				
				} else {
					$data['is_validate'] 	= true;
					$data['is_success'] 	= false;
					$data['msg'] 			= "Error: Email yang anda masukkan telah terdaftar.";
					
					
					$this->load->view('form_pendaftaran', $data);
						//$response = "Email yang anda masukkan telah terdaftar";
						//redirect("site/form_required/invalid_email/".$pin);
				}
			}
		}
	 }
	
	function createFotoCalonTaruna( $image ) {
		$width = 113;
		$height= 137;
	
		$ext = pathinfo($image, PATHINFO_EXTENSION);
		$ext = strtolower($ext);
		
		$source = '';
		if($ext == 'jpg' || $ext == 'jpeg')
		{
			$source = ImageCreateFromJPEG( base_url()."assets/images/foto_calon_taruna/".$image );
		}
		else if($ext == 'png')
		{
			$source = ImageCreateFromPNG( base_url()."assets/images/foto_calon_taruna/".$image );
		}
		
		//$source = ImageCreateFromJPEG( base_url()."assets/images/foto_calon_taruna/".$image );
		$imgFoto = imagecreatetruecolor($width, $height);
		$image_Fotopath = "./assets/images/foto_calon_taruna/";

		
		// resize image
		imagecopyresampled($imgFoto, $source, 0, 0, 0, 0, $width, $height, imagesx($source), imagesy($source));
		
		// save file to directory foto_calon_taruna img
		imageJPEG( $imgFoto, $image_Fotopath.$image, 100 );
		
		// clear up memory mi
		imagedestroy($source);
		imagedestroy($imgFoto);
	}
	
	 function sentEmail($data){
			//print_r($data);
            $smtp = Array(
						 'protocol'  => 'smtp',
						 'smtp_host' => 'ssl://smtp.googlemail.com',
						 'smtp_port' => 465,
						 'smtp_user' => 'noreply@thera.co.id',
						 'smtp_pass' => 'noreply123',
						 'mailtype'  => 'html',
						 'charset'   => 'iso-8859-1',
						 'newline'   => '\r\n'
					);


			$this->load->library('email', $smtp);
			$this->email->set_newline("\r\n");
			//$this->email->from($data['from']);
			$this->email->from('noreply@amg.co.id', 'PTB AMG '. $data['kota']);
			//$this->email->from('noreply@thera.co.id', 'AMG Info');
			$this->email->to($data['to']);
			$this->email->subject($data['subject']);
			$this->email->message($data['message']);
			$this->email->bcc($data['bcc']);

			if ( !$this->email->send()) {
				$return   = FALSE;
			} else {
				$return   = TRUE;
			}
			return $return;
	}

	 public function login()
	 {
	 	$this->load->view('login');
	 }
	 
	 public function panduan()
	 {
	 	$this->load->view('panduan');
	 }
	 
	 public function cetak()
	 {
		$post['username'] = $this->input->post('username');
		$post['password'] = $this->input->post('password');
		
		$this->load->model('siteModel');
		$result	= $this->siteModel->getLogin($post);
		
		$data['valid'] = false;
		if(count($result) > 0)
		{
			$data['valid'] = true;
			$data['detail']= $this->siteModel->getTarunaDetail($result['T_BILLING_ID']);

			$billingID = $result['T_BILLING_ID'];
			// disable PIN 
			$sql = "UPDATE student_register 
						set valid_to = null, login_date = now()
					WHERE T_BILLING_ID = '$billingID'";

			$this->db->query($sql);
			//----
						
		}
		
	 	$this->load->view('cetak_kartu', $data);
	 }
	 
	 public function ketentuan()
	 {
	 	$this->load->view('ketentuan');
	 }
	 
	 public function home()
	 {
	 	$this->load->view('home');
	 }
	 
	 public function via_teller()
	 {
	 	$this->load->view('via_teller');
	 }
	 
	 public function via_atm()
	 {
	 	$this->load->view('via_atm');
	 }
	 
	 public function via_banking()
	 {
	 	$this->load->view('via_banking');
	 }
	 
	 public function cetak_kartu()
	 {
	 	$this->load->view('cetak_kartu');
	 }
	 
	 public function tkd()
	 {
	 	$this->load->view('tkd');
	 }
	 
	 public function tka()
	 {
	 	$this->load->view('tka');
	 }
	 
	 public function tentang()
	 {
	 	$this->load->view('tentang');
	 }
	 
	 public function pendaftaranDetail($no_pendaftaran=0)
	{
		$this->load->model('adminModel');
		$data['row'] = $this->adminModel->getPendaftaranDetail( $no_pendaftaran );
		
		if (count($data['row'])==0) {
			$data['row']['no_pendaftaran'] 		= "";
			$data['row']['nama'] 				= "";
			$data['row']['tempat_lahir']		= "";
			$data['row']['tgl_lahir'] 			= "";
			$data['row']['jenis_kelamin'] 		= "";
			$data['row']['tinggi_badan'] 		= "";
			$data['row']['agama']				= "";
			$data['row']['propinsi_smtaID'] 	= "";
			$data['row']['tahun_lulus'] 		= "";
			$data['row']['jenis_smtaID'] 		= "";
			$data['row']['jurusan_smtaID'] 		= "";
			$data['row']['jurusanID'] 			= "";
			$data['row']['lokasiTKA'] 			= "";
			$data['row']['mat_4'] 				= "";
			$data['row']['fisika_4'] 			= "";
			$data['row']['inggris_4'] 			= "";
			$data['row']['mat_5'] 				= "";
			$data['row']['fisika_5'] 			= "";
			$data['row']['inggris_5'] 			= "";
			$data['row']['mat_6'] 				= "";
			$data['row']['fisika_6'] 			= "";
			$data['row']['inggris_6'] 			= "";
			$data['row']['register_date']		= "";
			$data['row']['email'] 				= "";
			$data['row']['alamat'] 				= "";
			$data['row']['kodepos'] 			= "";
			$data['row']['telepon'] 			= "";
		} else {
			//
		}
		//print_r($this->data);
	 	$this->load->view('pendaftarandetail', $data);
	}
	
	function printPdf($no_pendaftaran=0, $order='no_pendaftaran', $sort='asc', $page=1, $limit=50, $msg="") {
		
		$this->data['order']	= $order;
		$this->data['sort']		= $sort;
		$this->data['page']		= $page;
		$this->data['limit']	= $limit;
		$this->data['msg']		= $msg;

		//$this->data['back']	= $this->site['site']."admin/pendaftaran/$order/$sort/$page/$limit" ;
		$this->data['row'] 		= $this->siteModel->getPendaftaranDetail( $no_pendaftaran );
		
		// echo count($this->data['row']);))
		if (count($this->data['row'])==0) {
			$this->data['row']['no_pendaftaran']		= "";
			$this->data['row']['nama'] 							= "";
			$this->data['row']['tempat_lahir']			= "";
			$this->data['row']['tgl_lahir']					= "";
			$this->data['row']['jenis_kelamin']			= "";
			$this->data['row']['tinggi_badan'] 			= "";
			$this->data['row']['agama']							= "";
			$this->data['row']['propinsi_smtaID'] 	= "";
			$this->data['row']['tahun_lulus']				= "";
			$this->data['row']['jenis_smtaID']			= "";
			$this->data['row']['jurusan_smtaID']		= "";
			$this->data['row']['jurusanID']					= "";
			$this->data['row']['lokasiID']					= "";
			$this->data['row']['mat_4']							= "";
			$this->data['row']['fisika_4']					= "";
			$this->data['row']['inggris_4']					= "";
			$this->data['row']['mat_5']							= "";
			$this->data['row']['fisika_5']					= "";
			$this->data['row']['inggris_5']					= "";
			$this->data['row']['mat_6']				= "";
			$this->data['row']['fisika_6']			= "";
			$this->data['row']['inggris_6']			= "";
			$this->data['row']['register_date']		= "";
			$this->data['row']['email']				= "";
			$this->data['row']['alamat']			= "";
			$this->data['row']['kodepos']			= "";
			$this->data['row']['telepon']			= "";
		} else {
			//
		}
		
		//$data = $this->data;
		$this->smarty->assign('data', $this->data);
		$this->load->plugin('to_pdf_pi');
			     
		$data = $this->data;     
		$html = $this->load->view('home/pendaftaran_detail_2',$data, true);
		     
		pdf_create($html, 'pendaftaran_'.$no_pendaftaran);
	}  
		 
}

/* End of file site.php */
/* Location: ./application/controllers/site.php */